package org.come.Jpanel;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.math.BigDecimal;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;

import com.tool.btn.FormsOnOffBtn;
import com.tool.btn.RoleCaoZuoBtn;
import com.tool.tcpimg.UIUtils;
import com.updateNew.MyIsif;



public class NedanJpanel extends JPanel {
    private JLabel needExperience;
    private JTextArea areaMsg;// 内丹介绍
    private JLabel labNedanName,// 内丹名称
            labLevel,// 内丹等级
            labnumber,// 转生次数
            labExp,// 当前经验
            labTotalExp;// 升级经验

    private RoleCaoZuoBtn btnSpitOut,// 吐出内丹
            btnConversion;// 转换经验

    public NedanJpanel() throws Exception {
        if(MyIsif.getStyle().equals("水墨UI")) {
    		this.setPreferredSize(new Dimension(268, 323));
            this.setLayout(null);
            this.setOpaque(false);

            // 关闭按钮事件
            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/old/2/1.png", 1, 47);
            offBtn.setBounds(268 - 37, 10, 25, 25);
            this.add(offBtn);

            Font font2 = new Font("微软雅黑", 0, 13);
            // 内丹介绍
            areaMsg = new JTextArea();
            areaMsg.setBounds(60-14, 125, 185, 88);
            areaMsg.setLineWrap(true);
            areaMsg.setForeground(Color.WHITE);
            areaMsg.setFont(font2);
            areaMsg.setEnabled(false);
            areaMsg.setOpaque(false);
            this.add(areaMsg);

            // 内丹名称
            labNedanName = new JLabel();
            labNedanName.setBounds(133-14, 51, 116, 16);
            labNedanName.setForeground(Color.WHITE);
            labNedanName.setFont(font2);
            this.add(labNedanName);

            // 内丹等级
            labLevel = new JLabel();
            labLevel.setBounds(133-14, 74, 116, 16);
            labLevel.setForeground(Color.WHITE);
            labLevel.setFont(font2);
            this.add(labLevel);

            // 转生次数
            labnumber = new JLabel();
            labnumber.setBounds(133-14, 97, 116, 16);
            labnumber.setForeground(Color.WHITE);
            labnumber.setFont(font2);
            this.add(labnumber);

            // 当前经验
            labExp = new JLabel();
            labExp.setBounds(133-14, 231, 116, 16);
            labExp.setForeground(Color.WHITE);
            labExp.setFont(font2);
            this.add(labExp);

            // 升级经验
            labTotalExp = new JLabel();
            labTotalExp.setBounds(133-14, 254, 116, 16);
            labTotalExp.setForeground(Color.WHITE);
            labTotalExp.setFont(font2);
            this.add(labTotalExp);

            // 吐出内丹
            btnSpitOut = new RoleCaoZuoBtn("skin/8100226/newbutton/B22.png", 1, UIUtils.COLOR_WHITE2, UIUtils.TEXT_HY16, "吐出内丹", 0);
            btnSpitOut.setBounds(158-14, 280, 99, 24);
            this.add(btnSpitOut);

            // 转换经验
            btnConversion = new RoleCaoZuoBtn("skin/8100226/newbutton/B22.png", 1, UIUtils.COLOR_WHITE2, UIUtils.TEXT_HY16,
                    "转换经验", 0);
            btnConversion.setBounds(38-14, 280, 99, 24);
            this.add(btnConversion);
        }else {
            this.setPreferredSize(new Dimension(268, 323));
            this.setLayout(null);
            this.setOpaque(false);

            // 关闭按钮事件
            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/hongmu/s74.png", 1, 47);
            offBtn.setBounds(268 - 37, 10, 25, 25);
            this.add(offBtn);

            Font font2 = new Font("微软雅黑", 0, 13);
            // 内丹介绍
            areaMsg = new JTextArea();
            areaMsg.setBounds(60-14, 125, 185, 88);
            areaMsg.setLineWrap(true);
            areaMsg.setForeground(Color.WHITE);
            areaMsg.setFont(font2);
            areaMsg.setEnabled(false);
            areaMsg.setOpaque(false);
            this.add(areaMsg);

            // 内丹名称
            labNedanName = new JLabel();
            labNedanName.setBounds(133-14, 51, 116, 16);
            labNedanName.setForeground(Color.WHITE);
            labNedanName.setFont(font2);
            this.add(labNedanName);

            // 内丹等级
            labLevel = new JLabel();
            labLevel.setBounds(133-14, 74, 116, 16);
            labLevel.setForeground(Color.WHITE);
            labLevel.setFont(font2);
            this.add(labLevel);

            // 转生次数
            labnumber = new JLabel();
            labnumber.setBounds(133-14, 97, 116, 16);
            labnumber.setForeground(Color.WHITE);
            labnumber.setFont(font2);
            this.add(labnumber);

            // 当前经验
            labExp = new JLabel();
            labExp.setBounds(133-14, 231, 116, 16);
            labExp.setForeground(Color.WHITE);
            labExp.setFont(font2);
            this.add(labExp);

            // 升级经验
            labTotalExp = new JLabel();
            labTotalExp.setBounds(133-14, 254, 116, 16);
            labTotalExp.setForeground(Color.WHITE);
            labTotalExp.setFont(font2);
            this.add(labTotalExp);

            // 吐出内丹红木
            btnSpitOut = new RoleCaoZuoBtn("inkImg/hongmu/1_png.button.btn_xy.png", 1, UIUtils.COLOR_WHITE3, UIUtils.TEXT_HY16, "吐出内丹", 0);
            btnSpitOut.setBounds(158-14, 280, 99, 24);
            this.add(btnSpitOut);

            // 转换经验
            btnConversion = new RoleCaoZuoBtn("inkImg/hongmu/1_png.button.btn_xy.png", 1, UIUtils.COLOR_WHITE3, UIUtils.TEXT_HY16,
                    "转换经验", 0);
            btnConversion.setBounds(38-14, 280, 99, 24);
            this.add(btnConversion);
        }
    }

    ImageIcon icon;

    @Override
    protected void paintComponent(Graphics g) {
        if(MyIsif.getStyle().equals("水墨UI")) {
        super.paintComponent(g);
        	// 召唤兽技能
            if (icon == null) {
                icon = new ImageIcon("inkImg/newbackground/B320.png");
            }

            g.drawImage(icon.getImage(), 0, 0, 268, 323, this);
        }else {
            super.paintComponent(g);
            // 召唤兽技能
            if (icon == null) {
                icon = new ImageIcon("skin/8100226/button/hongmu/红木内丹.png");
            }

            g.drawImage(icon.getImage(), 0, 0, 268, 323, this);
        }
    }

    public JTextArea getAreaMsg() {
        return areaMsg;
    }

    public void setAreaMsg(JTextArea areaMsg) {
        this.areaMsg = areaMsg;
    }

    public JLabel getLabNedanName() {
        return labNedanName;
    }

    public void setLabNedanName(JLabel labNedanName) {
        this.labNedanName = labNedanName;
    }

    public JLabel getLabLevel() {
        return labLevel;
    }

    public void setLabLevel(JLabel labLevel) {
        this.labLevel = labLevel;
    }

    public JLabel getLabnumber() {
        return labnumber;
    }

    public void setLabnumber(JLabel labnumber) {
        this.labnumber = labnumber;
    }

    public JLabel getLabExp() {
        return labExp;
    }

    public void setLabExp(JLabel labExp) {
        this.labExp = labExp;
    }

    public JLabel getLabTotalExp() {
        return labTotalExp;
    }

    public void setLabTotalExp(JLabel labTotalExp) {
        this.labTotalExp = labTotalExp;
    }

    public RoleCaoZuoBtn getBtnSpitOut() {
        return btnSpitOut;
    }

    public void setBtnSpitOut(RoleCaoZuoBtn btnSpitOut) {
        this.btnSpitOut = btnSpitOut;
    }

    public RoleCaoZuoBtn getBtnConversion() {
        return btnConversion;
    }

    public void setBtnConversion(RoleCaoZuoBtn btnConversion) {
        this.btnConversion = btnConversion;
    }

}
